package com.xzw.test.springcloud.contorller;


import com.xzw.test.springcloud.api.feign.PaymentServiceFeign;
import com.xzw.test.springcloud.model.CommonResult;
import com.xzw.test.springcloud.model.Payment;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
public class FeignClientController {

    @Autowired
    private PaymentServiceFeign paymentServiceFeign;

    //@RequestMapping(value = "/feign/payment/get/{id}", method = RequestMethod.GET, produces = "application/json; charset=UTF-8")
    @GetMapping("/feign/payment/get/{id}")
    public CommonResult<Payment> getPayment(@PathVariable("id") Long id){
        log.info("feign请求接收参数id:{}",id);
        return paymentServiceFeign.getPaymentById(id);
    }
}
